<%@ page import="restfuljobs.JobApplication" %>


<div class="fieldcontain">Enter your Applicant ID or your First and Last name.</div>

<div class="fieldcontain ${hasErrors(bean: jobApplicationInstance, field: 'applicant', 'error')} required">
	<label for="applicant">
		<g:message code="jobApplication.applicant.label" default="Applicant" />		
	</label>	
	<g:textField name="applicantId" value="${jobApplicationInstance?.applicant?.id}" size="2"/>
    Or
    | 
    First name <g:textField name="firstName" value="${jobApplicationInstance?.applicant?.firstName}" size="4"/>
	Last name <g:textField name="lastName" value="${jobApplicationInstance?.applicant?.lastName}" size="4"/>
</div>

<div class="fieldcontain ${hasErrors(bean: jobApplicationInstance, field: 'jobListing', 'error')} required">
	<label for="jobListing">
		<g:message code="jobApplication.jobListing.label" default="Job Listing" />
		<span class="required-indicator">*</span>
	</label>
	<b>${jobApplicationInstance.jobListing}</b>
	<g:hiddenField name="jobListing.id" value="${jobApplicationInstance.jobListing.id}" />	
</div>

<div class="fieldcontain ${hasErrors(bean: jobApplicationInstance, field: 'comments', 'error')} ">
	<label for="comments">
		<g:message code="jobApplication.comments.label" default="Comments" />
		
	</label>
	<g:textArea name="comments" value="${jobApplicationInstance?.comments}"/>
</div>

<div class="fieldcontain ${hasErrors(bean: jobApplicationInstance, field: 'education', 'error')} ">
	<label for="education">
		<g:message code="jobApplication.education.label" default="Education" />
		
	</label>
	<g:textArea name="education" value="${jobApplicationInstance?.education}"/>
</div>

<div class="fieldcontain ${hasErrors(bean: jobApplicationInstance, field: 'experience', 'error')} ">
	<label for="experience">
		<g:message code="jobApplication.experience.label" default="Experience" />
		
	</label>
	<g:textArea name="experience" value="${jobApplicationInstance?.experience}"/>
</div>


<g:if test="${!jobApplicationInstance.id}">
	<g:hiddenField name="status" value="APPLICATION_RECEIVED" />
</g:if>
<g:elseif test="${session.user && session.user.type == restfuljobs.User.Type.RECRUITER}">
<div class="fieldcontain ${hasErrors(bean: jobApplicationInstance, field: 'status', 'error')} required">
	<label for="status">
		<g:message code="jobApplication.status.label" default="Status" />
		<span class="required-indicator">*</span>
	</label>
	<g:select name="status" from="${restfuljobs.JobApplication$Status?.values()}" keys="${restfuljobs.JobApplication$Status.values()*.name()}" required="" value="${jobApplicationInstance?.status?.name()}"/>
</div>
</g:elseif>


